]> permondes.de Git - Analog_Engine.git/blame_incremental - scripts/EP1 10.03 Coupled Pendulums.LACE
Further examples of harmonic oscillation
[Analog_Engine.git] / scripts / EP1 10.03 Coupled Pendulums.LACE
... / ...
CommitLineData
1# 2 coupled pendulums
2# x1'' = -k1*x1 + k*(x2-x1)
3# x2'' = -k2*x2 - k*(x2-x1)
4# xi are the displacement of the pendulum to its resting position
5
6coefficient.1 -> k1
7coefficient.2 -> k2
8coefficient.3 -> k
9coefficient.5(-1) -> -x10 # initial displacement x1
10coefficient.6(-1) -> -x20 # initial displacement x2
11
12iintegrate x1'' -> -x1'
13iintegrate -x1' -> x1
14 IC: -x10
15
16iintegrate x2'' -> -x2'
17iintegrate -x2' -> x2
18 IC: -x20
19
20cmultiply x1, k1 -> k1*x1
21cmultiply x2, k2 -> k2*x2
22
23invert x1 -> -x1
24isum x2, -x1 -> -(x2-x1)
25cmultiply -(x2-x1), k -> -k*(x2-x1)
26
27isum k1*x1, -k*(x2-x1) -> -k1*x1+k*(x2-x1)
28assign -k1*x1+k*(x2-x1) -> x1''
29invert -k*(x2-x1) -> k*(x2-x1)
30isum k2*x2, k*(x2-x1) -> -k2*x2-k*(x2-x1)
31assign -k2*x2-k*(x2-x1) -> x2''
32
33output x1 -> out.x
34output x2 -> out.y